]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: Only create thumbnails once
authorSebastian Keller <skeller@gnome.org>
Thu, 29 Apr 2021 14:07:21 +0000 (16:07 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 29 Apr 2021 17:58:45 +0000 (17:58 +0000)
`ThumbnailsBox` listens for the `showing` signal from the `Overview` to
create its thumbnails and destroys them on the `hide` signal. Since the
`showing` signal can be emitted multiple times when switching between
the shown and hidden state without ever fully completing the transition,
this will cause `_createThumbnails` to be called multiple times, each
time adding another set of workspaces.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3819
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1828>

js/ui/workspaceThumbnail.js

index 6c5a2bee4ab8d77cf84b3e8714ddfac913a0ffbe..3a7d916ca263a66ae4823196d3e85b196614cf97 100644 (file)
@@ -993,6 +993,9 @@ var ThumbnailsBox = GObject.registerClass({
     }
 
     _createThumbnails() {
+        if (this._thumbnails.length > 0)
+            return;
+
         let workspaceManager = global.workspace_manager;
 
         this._nWorkspacesNotifyId =